(function(){
	var type = window.pageConfig.fileType,
	dataBagId = window.pageConfig.dataBagId,
	dataBagToken = window.pageConfig.dataBagToken,
	fileName = window.pageConfig.fileName,
	isFolder = window.pageConfig.isFolder;
	if(isFolder){
		$('#view-wrap').append($('<p>', {'class': 'download-folder-tip', text: '暂不提供文件夹预览，请点击下边的按钮下载文件夹包'}))
		.append($('#download-btn').clone().removeAttr('id').addClass('btn btn-large').text(fileName + '.zip'));
	    return;
	}
//    if(/rvt|dwg/.test(type)){
//        $("#view-wrap").html("<iframe class='databag-flag' dataBagId="+dataBagId+" filename="+ fileName +" frameborder=0 width=100% height=100% scrolling=no src='"+window._global.databagURL+"/public/"+dataBagId+"?type='"+type+"></iframe>").show(); 
//    }
//    else {
	if(dataBagId){
		$("#view-wrap").html("<iframe class='databag-flag' dataBagId="+dataBagId+" frameborder=0 width=100% height=100% filename="+ fileName +" scrolling=no src='"+window._global.databagURL+"/public/"+dataBagToken+"?type="+type+"'></iframe>").show(); 
	}
	else{
		$('#view-wrap').append($('<p>', {'class': 'download-folder-tip', text: '请点击下载'}))
		.append($('#download-btn').clone().removeAttr('id').addClass('btn btn-large').text(fileName));
	}
//    }
})();